var row = 3;
var column = 5;
if (row < 3 || column < 3) {
    alert("\u884c\u6570\u548c\u5217\u6570\u5fc5\u987b\u4e0d\u5c0f\u4e8e3");
}
var width = 608;
var height = 320;
var c = width - (column - 1);
var g = height - (row - 1);
var h = (c - c % column) / column;
var u = (g - g % row ) / row;
var d = [];
for (var f = 0; f < row; f++) {
    d[f] = [];
    for (var p = 0; p < column; p++) {
        var m = {};
        m.x = p * h + p;
        m.y = f * u + f;
        if (f > 0 & f < row - 1 & p > 0 & p < column - 1) {
            continue
        }
        d[f][p] = m
    }
}
for (var f = 0; f < row; f++) {
    if (f == row - 1) {
        d[f].reverse()
    }
}
var w = [];
w = w.concat(d[0]);
for (var f = 1; f < row - 1; f++) {
    w = w.concat(d[f][column - 1])
}
w = w.concat(d[row - 1]);
for (var f = row - 2; f > 0; f--) {
    w = w.concat(d[f][0])
}
console.log(w);